package com.wangshili.common.config;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.wangshili.common.annotation.RequiredLog;

/**
 * 页面跳转配置
 * @author wangshili
 *
 */
@Configuration
public class PageConfig implements WebMvcConfigurer {

	@Override
	public void addViewControllers(ViewControllerRegistry registry) {
		//让页面直接访问到启动页面
		registry.addViewController("/").setViewName("starter.html");
	}
	

    //配置spring mvc 拦截器

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
            registry.addInterceptor(new TimeAccessInterceptor())
                    .addPathPatterns("/doLogin");
    }
}
